package com.suixuan.support.util.web.vo;

import com.suixuan.support.util.ErrorCodeUtils;

/**
 * 
 * 
 * Nanjing Zhou Su co.,Ltd
 * 
 * @Title: ErrorVo.java
 * @Package: com.suixuan.spring.web.vo.base
 * @Description: 错误信息
 * @Author: 束剑
 * @Date 2010-3-15 下午09:30:55
 * @Version V1.0
 * 
 */
public final class ErrorVo {

	private long errorCode = -1;

	private String errorMessage = "";

	/**
	 * 创建一个错误信息
	 * 
	 * @param errorCode
	 *            错误码
	 * @return 错误信息对象
	 */
	public static ErrorVo instance(Long errorCode) {
		return new ErrorVo(errorCode, ErrorCodeUtils
				.getErrorDescription(errorCode));
	}

	/**
	 * @param errorCode
	 * @param errorMessage
	 */
	private ErrorVo(long errorCode, String errorMessage) {
		super();
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}

	/**
	 * @return the errorCode
	 */
	public long getErrorCode() {
		return errorCode;
	}

	/**
	 * @param errorCode
	 *            the errorCode to set
	 */
	public void setErrorCode(long errorCode) {
		this.errorCode = errorCode;
	}

	/**
	 * @return the errorMessage
	 */
	public String getErrorMessage() {
		return errorMessage;
	}

	/**
	 * @param errorMessage
	 *            the errorMessage to set
	 */
	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
}
